<?php

namespace Applications\Backoffice;

class BackofficeApplication extends \Library\Application {

    public function __construct() {
        parent::__construct();
        $this->name = 'Backoffice';
    }

    public function run() {
        if ($this->user->isAuthenticated()) {
            $controller = $this->getController();
            $controller->execute();
            $this->httpResponse->setPage($controller->page());
            $this->httpResponse->send();
        } else {
            $this->httpResponse()->redirect('../login.html');
        }
    }

}

?>
